package com.mrzhou.log.feign;

import com.mrzhou.core.tool.api.R;
import com.mrzhou.core.tool.constants.TokenConstant;
import com.mrzhou.log.entity.LogApi;
import com.mrzhou.log.entity.LogError;
import com.mrzhou.log.entity.LogUsual;
import com.mrzhou.log.feign.factory.LogFeignFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @author qiang.zhou
 */
@FeignClient(value = "cloud-log", fallbackFactory = LogFeignFactory.class)
public interface ILogFeignClient {

    @PostMapping("/log/error/submit")
    R<String> errorSubmit(@RequestBody LogError logError, @RequestHeader(TokenConstant.TOKEN_HEADER_NAME) String cloudAuth);

    @PostMapping("/log/api/submit")
    R<String> apiSubmit(@RequestBody LogApi logApi);

    @PostMapping("/log/usual/submit")
    R<String> usualSubmit(@RequestBody LogUsual logUsual, @RequestHeader(TokenConstant.TOKEN_HEADER_NAME) String cloudAuth);

}
